package logic

import (
	"context"
	"week52/common/proto/class"
	"week52/service/server"
)

type ClassServer struct {
	class.UnimplementedClassServer
}

func (c ClassServer) AddClass(ctx context.Context, in *class.AddClassReq) (*class.AddClassResp, error) {
	addClass, err := server.AddClass(in)
	if err != nil {
		return nil, err
	}
	return addClass, nil
}

func (c ClassServer) ClassDetail(ctx context.Context, in *class.ClassDetailReq) (*class.ClassDetailResp, error) {
	detail, err := server.ClassDetail(in)
	if err != nil {
		return nil, err
	}
	return detail, nil
}

func (c ClassServer) AddClassOrder(ctx context.Context, in *class.AddClassOrderReq) (*class.AddClassOrderResp, error) {
	order, err := server.AddClassOrder(in)
	if err != nil {
		return nil, err
	}
	return order, nil
}

func (c ClassServer) TrueOrder(ctx context.Context, in *class.TrueOrderReq) (*class.TrueOrderResp, error) {
	order, err := server.TrueOrder(in)
	if err != nil {
		return nil, err
	}
	return order, nil
}

func (c ClassServer) StatusOrderList(ctx context.Context, in *class.StatusOrderListReq) (*class.StatusOrderListResp, error) {
	list, err := server.StatusOrderList(in)
	if err != nil {
		return nil, err
	}
	return list, nil
}

func (c ClassServer) TellSmall(ctx context.Context, in *class.TellSmallReq) (*class.TellSmallResp, error) {
	tellSmall, err := server.TellSmall(in)
	if err != nil {
		return nil, err
	}
	return tellSmall, nil
}
